/**
 * author:Administrator
 * date:2015/8/17
 * desc:初始化操作a
 */
"use strict";

// 连接 mongo server
var C = require('../../config/index.js');
var mongoose = require('mongoose');

var inited = false;
module.exports.initFun = function () {
    if (inited)return;
    if (mongoose.connection.readyState === 1) {
        //console.log('-------------   mongodb already connect');
    } else {
        //console.log('-------------   mongodb not connect');
        mongoose.connect(C.mongo.uri, C.mongo.options);
    }

    // 连接 es server
    // let esClient = require('./es/elasticSearch.js');

    inited = true;
};